<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

    <h3>(对象)取数据</h3>
    <table border="1" width="200">
        <tr>
            <th>ID</th>
            <th>部门</th>
        </tr>
        {% for foo in obj %}
            <tr style="text-align: center;">
                <td>{{ foo.id }}</td>
                <td>{{ foo.caption }}</td>
            </tr>
        {% endfor %}
    </table>

    <h3>(字典)取数据</h3>
    <table border="1" width="200">
        <tr>
            <th>ID</th>
            <th>部门</th>
        </tr>
        {% for foo in obj1 %}
            <tr>
            <td>{{ foo.id }}</td>
            <td>{{ foo.caption }}</td>
            </tr>
        {% endfor %}
    </table>

    <h3>(元组)取数据</h3>
    <table border="1" width="200">
        <tr>
            <th>ID</th>
            <th>部门</th>
        </tr>
        {% for foo in obj2 %}
            <tr>
            <td>{{ foo.0 }}</td>
            <td>{{ foo.1 }}</td>
            </tr>
        {% endfor %}
    </table>
</body>
</html>